
function req(obj) {
	var URL = 'https://www.......'
  return new Promise((resolve, reject) => {
	const HOST = URL
	var method = obj.method || "POST"; 
	var url = HOST + obj.url || "";  
	var header = obj.header || {
	    'Content-Type': obj.contentType || 'application/json' ||'application/x-www-form-urlencoded',
	}; 
	var success = obj.success; // 成功回调函数
	var fail = obj.fail; //表示失败后，要执行的回调函数
        var data = obj.data || {}
        var token = {
			token: uni.getStorageSync('token')
		}
        // var dataToken = Object.assign(token, data) 
		var dataToken = Object.assign(data) 
	uni.request({
		url: url,
		data: dataToken,
        method: method,
		header: header,
		success: ((res) => {
            resolve(res)
		}),
		fail: ((err) => {
			reject(err)
		})
	})
  })
}
export default req